package com.lsu.app.bean;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotNull;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;

/**
 * 通知表
 * @Date 2023-10-25 18:02:23
 * @author hjj
 */
@Data
@TableName("notice")
@ApiModel(value="Notice对象", description="通知表")
public class Notice implements Serializable {

    @ApiModelProperty("#id")
    private Integer id;

    @NotNull(message="[通知类型（1课程提醒，2课程反馈，3消息回复[用户对用户]）]不能为空")
    @ApiModelProperty("通知类型（1课程提醒，2课程反馈，3消息回复[用户对用户]）")
    private Integer type;

    @ApiModelProperty("发送推送者id")
    private Integer relateId;

    @TableField(exist = false) //该字段不存在于数据库中
    @ApiModelProperty("#发送者昵称")
    private String relateName;

    @TableField(exist = false) //该字段不存在于数据库中
    @ApiModelProperty("#发送者头像")
    private String relateImgUrl;

    @TableField(exist = false) //该字段不存在于数据库中
    @ApiModelProperty("#接收者头像")
    private String targetUserImgUrl;

    @NotBlank(message="[标题]不能为空")
    @Size(max= 128,message="编码长度不能超过128")
    @ApiModelProperty("标题")
    private String title;

    @Size(max= 255,message="编码长度不能超过255")
    @ApiModelProperty("#内容")
    private String content;

    @NotNull(message="[若为用户回复用户，此项为0]不能为空")
    @ApiModelProperty("推送类id")
    private Integer targetId;

    @TableField(exist = false) //该字段不存在于数据库中
    @ApiModelProperty("#推送类名称")
    private String targetName;

    @NotNull(message="[接收者id]不能为空")
    @ApiModelProperty("接收者id")
    private Integer targetUserId;

    @TableField(exist = false) //该字段不存在于数据库中
    @ApiModelProperty("#接收者昵称")
    private String targetUserNicName;

    @ApiModelProperty("#信息状态[1未读，2已读，0已读且删除]")
    private Integer state;

    @ApiModelProperty("#创建时间")
    private String createTime;

    public Notice() {
    }

    public Notice(Integer type, Integer relateId, String title, String content, Integer targetId, Integer targetUserId, Integer state, String createTime) {
        this.type = type;
        this.relateId = relateId;
        this.title = title;
        this.content = content;
        this.targetId = targetId;
        this.targetUserId = targetUserId;
        this.state = state;
        this.createTime = createTime;
    }
}
